import request from '/@/utils/request'

const apiText = 'supplier_type'

// 查
export function getSupplierClassifyApi(params: any) {
  return request({
    url: `/api/${apiText}/list`,
    method: 'get',
    params,
  })
}

// tree查
export function getSupplierClassifyTreeApi() {
  return request({
    url: `/api/${apiText}/tree`,
    method: 'get',
  })
}

// 增
export function addSupplierClassifyApi(data: any) {
  return request({
    url: `/api/${apiText}/create`,
    method: 'post',
    data,
  })
}

// 改
export function editSupplierClassifyApi(data: any) {
  return request({
    url: `/api/${apiText}/update/${data.id}`,
    method: 'put',
    data,
  })
}

// 删
export function delSupplierClassifyApi(id: any) {
  return request({
    url: `/api/${apiText}/delete/${id}`,
    method: 'delete',
  })
}

// 删 评分维度
export function delSupplierClassifyDimensionApi(id: any) {
  return request({
    url: `/api/${apiText}/dimension/${id}`,
    method: 'delete',
  })
}
